package com.infosys.setl.fp.demo3;

import org.apache.commons.functor.BinaryFunction;
import org.apache.commons.functor.UnaryFunction;

public class BinaryFunctionUnaryFunction implements UnaryFunction<Double, Double> {
    private BinaryFunction<Double, Double, Double> function;

    public BinaryFunctionUnaryFunction(BinaryFunction<Double, Double, Double> f) {
        function = f;
    }

    public Double evaluate(Double obj) {
        return function.evaluate(obj, obj);
    }
}
